package link.anyauto.weclass.demos.viewpager;

import android.app.Activity;

import link.anyauto.weclass.R;
import link.anyauto.weclass.adapter.OneTypeItemSource;
import link.anyauto.weclass.base.BaseVMAdapter;

/**
 * Created by Administrator on 2017/2/19.
 */

public class PagerVM extends BaseVMAdapter {

    public OneTypeItemSource source;

    public PagerVM(Activity activity) {
        setActivity(activity);
        source = new OneTypeItemSource();
        initItems();
        source.itemViewId = R.layout.demo_view_pager_item;
        title(R.string.view_pager_demo);
    }

    void initItems() {
        for (int i=0; i<100; i++) {
            PagerItem item = new PagerItem();
            item.title = "这是第" + i + "页标题";
            item.content = "这里是第" + i + "页Pager的内容。欢迎浏览，祝你生活愉快！";
            source.items.add(item);
        }
    }
}
